import axios from "axios"
const envUrl = import.meta.env.VITE_API_BASE_URL
console.log('envUrl', envUrl);
// const envUrl = false
// 获取界分类
export const getGeneData = (params) => {
    return axios({
        method: "GET",
        url: envUrl + `/geneData/kingdoms/`,
        params
    })
}
// 根据界获取门分类
export const getGeneDataPhylum = (params) => {
    return axios({
        method: "GET",
        url: envUrl + `/geneData/phylum/`,
        params
    })
}
// 根据门获取纲分类
export const getGeneDataClass = (params) => {
    return axios({
        method: "GET",
        url: envUrl + `/geneData/classApi/`,
        params
    })
}
// 根据纲获取目信息
export const getGeneDataOrder = (params) => {
    return axios({
        method: "GET",
        url: envUrl + '/geneData/order/',
        params
    })
}
// 搜索查询微生物数据
export const getGeneDataSearch = (params) => {
    return axios({
        method: "GET",
        url: envUrl + '/geneData/search/',
        params
    })
}
// 根据目获取科分类
export const getGeneDataFamily = (params) => {
    return axios({
        method: "GET",
        url: envUrl + `/geneData/family`,
        params
    })
}
// 根据目获取科分类 --- 已停用
export const getGeneDataFamily2 = (params) => {
    return axios({
        method: "GET",
        url: envUrl + `/geneData/family2/${params.type}`,
    })
}

// 根据科获取属信息
export const getGeneDataGenus = (params) => {
    return axios({
        method: "GET",
        url: envUrl + `/geneData/genes/`,
        params
    })
}
// 细菌-根据属获取种信息
export const getGeneDataSpecies = (params) => {
    return axios({
        method: "GET",
        url: envUrl + '/geneData/species/',
        params
    })
}
// 根据ID搜索查询微生物数据
export const getGeneDataForSearchById = (params) => {
    return axios({
        method: "GET",
        url: envUrl + '/geneData/searchById/',
        params
    })
}

// 数据浏览
export const geneDataBrowse = (params) => {
    return axios({
        method: "GET",
        url: envUrl + '/geneData/dataBrowse/',
        params
    })
}

// 数据导出
export const geneDataExport = (params) => {
    return axios({
        method: "GET",
        url: envUrl + '/geneData/dataExport/',
        params
    })
}
// 首页查询-默认查询病毒库
export const getHomeSearchData = (params) => {
    return axios({
        method: "GET",
        url: envUrl + '/geneData/homeSearch/',
        params
    })
}
// 根据GeneID获取NucleicAcid文件
export const getNucleicAcidContent = (params) => {
    return axios({
        method: "GET",
        url: envUrl + `/geneData/getNucleicAcidContent/${params.type}/${params.id}/${params.str}`,
    })
}

// 根据GeneID获取NucleicAcid文件
export const dataBrowseSearch = (params) => {
    return axios({
        method: "GET",
        url: envUrl + `/geneData/dataBrowseSearch/`,
        params
    })
}
// 根据GeneID获取NucleicAcid文件
export const searchDownResDownload = (params) => {
    return axios({
        method: "GET",
        url: envUrl + `/geneData/searchDownRes`,
        responseType: 'blob',
        params
    })
}
